The present invention relates to a semiconductor memory device that is suitable for storing data having a two-dimensional structure, such as, for instance, image data, and is capable of efficiently reading out stored image data in an arbitrary, vertical or horizontal direction.
In equipment processing digital data, such as DVD (Digital Video Disc), and the like, errors produced by noise during information reproduction and transfer are eliminated by using ECC (Error Correction Coding) protocols. In error detection and correction, redundant components are attached to transferred information and detection and correction of errors is carried out by using these redundant components. The Reed Solomon code, which has a good code efficiency and a high error correction capability, is used in DVD and such.
In the error correction code used in DVD, in order to further increase the error correction capability, information is divided into blocks of predetermined size, the information in block form is mapped to a mathematical two-dimensional space (XY space), and redundant code (Reed Solomon code) independent in two directions, the X direction and the Y direction, is attached.
For this reason, in order to effect encoding by attaching redundant code to the information to be recorded during data recording, as well as in order to carry out error correction processing on the reproduced information during data reproduction to effect decoding of correct information, independent calculations are carried out, respectively, in the X direction and Y direction.
Specifically, for instance, in the case of recording data to a DVD, once the write data have been stored in memory, by using the data stored in memory, data are read out by scanning in the X direction and Y direction, and error correction code is generated. Then, data used for recording are generated by combining the generated error correction code and initial write data and are recorded to the DVD.
Also, in the case of reproducing data from a DVD, once the reproduced data have been stored in memory, by using the data stored in memory, readout is carried out by scanning in the X direction and Y direction, and error correction code is generated. Then, it is determined whether the reproduced data are correct by comparing the generated error correction code with the reproduced error correction code, and when there is an error, error correction processing is carried out.
Incidentally, when such error correction processing is carried out, the problem is that processing cannot be efficiently carried out in the case of using current memories (semiconductor memory devices).
As was described above, when error correction processing is carried out, when data subject to processing are input, scanning of the data is carried out in the X direction and Y direction, and calculations are performed on the read-out data. When recording data to ordinary memory, however, in many cases a plurality of data are packaged and recorded as a single word, and the problem with such a case is that efficient access is impossible in both the X direction and the Y direction.
For instance, when data are stored in memory, usually, this is carried out by words constituting units of 8 bits, 16 bits, 32 bits, etc. On the other hand, with image data, a single pixel data element is in many cases represented by 1 bit, 2 bits, 4 bits, 8 bits, and the like. In such a case when, for instance, a single pixel data element is four bits, then in many cases one word is composed of 8-bit or 16-bit data made up of data of 2 pixels or 4 pixels continuously aligned, for example, in the X direction, and it is recorded to memory as a unit.
Then, in such a case, when carrying out error correction processing by reading out successive data in the X direction, each time data of a single word are read out, the necessary successive data of two pixels or four pixels are read out without any problem, but should error correction processing be carried out by reading out successive data in the Y direction, in a single word, there is only one element of the necessary pixel data, and, in addition to the necessary data, excessive data of one pixel or three pixels continuously aligned with this data in the X direction are necessarily included therein. Therefore, the frequency of memory access when carrying out error correction processing by scanning in the Y direction is two or four times as high as the frequency of memory access in the case of carrying out error correction processing by scanning in the X direction, which of course results in a corresponding increase in processing time.
Therefore, the object of the present invention is to provide a semiconductor memory device capable of efficiently and rapidly accessing continuously aligned data in both the X direction and Y direction when storing data having a two-dimensional structure, such as when each data element is specified by a position in the X direction and Y direction, for example, capable of efficiently carrying out processing of excess [sic] correction code generation with respect to stored image data.
In order to solve the above-mentioned problems, data of NxN pixels in the X direction and Y direction are recorded to the same simultaneously accessible page or word of memory, and, after simultaneously accessing them, the data of the desired N pixels continuously aligned in the X direction and Y direction can be selected and output.
Therefore, the semiconductor memory device of the present invention has a storage means for storing data having a two-dimensional structure, in which each data element is specified by a position in a first direction and a position in a second direction, and an output means for substantially simultaneously reading out and outputting a plurality of predetermined above-mentioned data aligned in a desired direction, that is, either in the above-mentioned first direction or the above-mentioned second direction, from the above-mentioned stored data having a two-dimensional structure.
Appropriately, the above-mentioned storage means stores the above-mentioned data having a two-dimensional structure so that they can be simultaneously read out in N blocks having Nxc3x97N data elements in the above-mentioned first direction and the above-mentioned second direction, with the above-mentioned output means having a block designation means for designating the desired above-mentioned blocks in the above-mentioned stored data having a two-dimensional structure, a data reproduction means for reproducing Nxc3x97N data elements. of the above-mentioned designated blocks, a data designation means for designating N data elements of a single type in N data elements of 2xc3x97N types aligned in the above-mentioned first direction or second direction which are contained in the above-mentioned read-out blocks, a data selection means for selecting the above-mentioned designated N data elements in the above-mentioned read-out NxN data elements, and N data output means for outputting the above-mentioned selected N data elements.
Specifically, the above-mentioned data selection means has an Nxc3x97N output control means provided for each of the above-mentioned reproduced Nxc3x97N data elements, connected to each of the above-mentioned N data output means in such a manner that all of the data that are not in the same column in the above-mentioned first direction and the above-mentioned second direction are all connected to the same above-mentioned data output means, and that controls the output of each of the above-mentioned reproduced data elements with the above-mentioned output control means, which corresponds to the above-mentioned designated N data elements, selecting the above-mentioned designated N data elements from the above-mentioned read-out Nxc3x97N data elements by outputting the corresponding data to the above-mentioned connected data output means.
Also, specifically, the above-mentioned data selection means has Nxc3x97N control means provided for each of the above-mentioned reproduced Nxc3x97N data elements and controls the output of the above-mentioned reproduced data based on the designation of the above-mentioned output N data elements, and a data switching means for arranging the N data elements selectively output from the above-mentioned NxN control means so as to generate data in a mutually predetermined positional relationship with respect to the above-mentioned first direction and the above-mentioned second direction and outputting them to the above-mentioned N data output means.
Specifically, the above-mentioned data are represented by a predetermined number of bits, the above-mentioned data having a two-dimensional structure are image data, and the above-mentioned data elements are pixel data of the above-mentioned image data.